-
Notifications
You must be signed in to change notification settings - Fork 0
fix: MeshDoctor: ensure consistent node numbering between 2D element and 3D faces #219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
jhuang2601
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing it!
jafranc
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great missing case
| if neighborCell.GetCellDimension() == 3: | ||
| # This 3D cell has a mapping - use it for the 2D cell | ||
| if neighborId in cellToNodeMapping: | ||
| cell_2d_to_mapping[ c ] = dict( cellToNodeMapping[ neighborId ] ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wouldn't this add the full neighbor cell's mapping and not only the partial mapping for the 2d cell ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jafranc you are absolutely correct, this was a bit lazy on my part.
I removed these extra mappings for code clarity and memory efficiency.
Thanks for catching this!
Co-authored-by: Jacques Franc <49998870+jafranc@users.noreply.github.com>
Co-authored-by: Jacques Franc <49998870+jafranc@users.noreply.github.com>
Co-authored-by: paloma-martinez <104762252+paloma-martinez@users.noreply.github.com>
Co-authored-by: Jacques Franc <49998870+jafranc@users.noreply.github.com>
Co-authored-by: Jacques Franc <49998870+jafranc@users.noreply.github.com>
When splitting a mesh at fracture locations, node duplication mappings were only applied to 3D cells (volume elements). 2D cells (faces/surfaces) that share the same nodes were not updated, causing them to reference old node IDs after the split.
This PR ensures consistent node indexing across all cell dimensions, thus preventing geometric inconsistencies at fracture interfaces.
Note that neither this fix nor the original code guarantees the preservation of the original numbering after splitting.